<meta title="新建管理员" width="650px" />
<form role="form" id="managerForm" s="valid,form"
      class="form-horizontal"
      method="post"
      style="padding: 20px;" action="/api/manager">
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">姓名：</label>
        <div class="col-sm-10">
            <input autocomplete="off" type="text" name="name" class="form-control" placeholder="姓名" s-valid-error="require()">
        </div>
    </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">账号：</label>
        <div class="col-sm-10">
            <input autocomplete="off" type="text" name="username" class="form-control" placeholder="账号"
                   s-valid-error="require()">
        </div>
    </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">密码：</label>
        <div class="col-sm-10">
            <input autocomplete="off" type="password" name="password" class="form-control"
                   s-valid-id="password"
                   s-valid-label="密码"
                   placeholder="请输入6-12位的密码" s-valid-error="require(),len(6,12)">
        </div>
    </div>
    <div class="form-group" s-valid-role="item">
        <label class="col-sm-2 control-label">确认密码：</label>
        <div class="col-sm-10">
            <input autocomplete="off" type="password" name="rePassword"
                   s-valid-label="确认密码"
                   class="form-control" placeholder="确认密码" s-valid-error="require(),len(6,12),eq('password')" >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态：</label>
        <div class="col-sm-10">
            <select class="form-control" name="locked">
                <option value="false">正常</option>
                <option value="true">锁定</option>
            </select>
        </div>
    </div>
</form>
<script type="text/javascript">
    S.meta.btns = [
        {
            name: "保存",
            style: "btn btn-primary",
            click: function(){
                return S.S("#managerForm").submit().done(function(rs){
                    S.close(true);
                    S.notice("新增管理员成功", "success");
                });
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function(){
                S.close();
            }
        }
    ]
</script>